package com.marklogic.ps.servicetester.domain;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

public class ServiceTesterPreferences {
	
	private Map<String, ServerConnectionInfo> serverConnectionInfo;
	
	public ServiceTesterPreferences() {
		serverConnectionInfo = new TreeMap<String, ServerConnectionInfo>();
	}

	public Collection<ServerConnectionInfo> getServerConnectionInfo() {
		Collection c = serverConnectionInfo.values();
		List list = new ArrayList();
		list.addAll(c);
		Collections.sort(list);
		return list;
	}

//	public void setServerConnectionInfo(
//			Map<String, ServerConnectionInfo> serverConnectionInfo) {
//		this.serverConnectionInfo = serverConnectionInfo;
//	}
	
	public ServerConnectionInfo addServerConnectionInfo(ServerConnectionInfo sci) {
		return serverConnectionInfo.put(sci.getBaseUrl(), sci);
	}


}
